<template>
  <div class="table-box">
    <It-Table
      :cols="cols"
      :data-source="datalist"
      @rowClick="tableRowClick"
    ></It-Table>
  </div>
  <div>点击了：{{ clicktitle }}</div>
</template>
<script setup>
import { ref } from 'vue'
import { ItTable } from '@/components'

const cols = [
  { label: '序号', key: 'seat', width: '10%' },
  { label: '机构名称', key: 'title', width: '20%' },
  { label: '最近投资企业', key: 'recentInvestment', width: '25%' },
  { label: '最近单笔投资额', key: 'singleInvestment', width: '25%' },
  { label: '累计投资事件', key: 'investmentTotal', width: '20%' },
]

const datalist = [
  {
    seat: 1,
    pkid: 1231,
    title: '标题1',
    singleInvestment: 'asdfasdf',
    recentInvestment: 12312,
    investmentTotal: 22,
  },
  {
    seat: 2,
    pkid: 12312,
    title: '标题2',
    singleInvestment: 'asdfasdadsf',
    recentInvestment: 121312,
    investmentTotal: 223,
  },
]
const clicktitle = ref('')
const tableRowClick = (v) => {
  clicktitle.value = v.title
}
</script>
<style scoped></style>
